import type { AppRouteModule } from '@/router/types';

import { LAYOUT } from '@/router/constant';
import { t } from '@/hooks/web/useI18n';

const permission: AppRouteModule = {
  path: '/permission',
  name: 'Permission',
  component: LAYOUT,
  redirect: '/permission/role',
  meta: {
    orderNo: 15,
    icon: 'ion:key-outline',
    title: t('routes.demo.permission.permission'),
  },

  children: [
    {
      path: 'role',
      name: 'rolePage',
      component: () => import('@/views/permissions/permission-role/index.vue'),
      meta: {
        title: t('routes.index.permission.role')
      }
    },
    {
      path: 'user',
      name: 'user',
      component: () => import('@/views/permissions/permission-user/index.vue'),
      meta: {
        title: t('routes.index.permission.user')
      }
    },
    {
      path: 'dictionary',
      name: 'dict',
      component: () => import('@/views/permissions/permission-dictionary/index.vue'),
      meta: {
        title: t('routes.index.permission.dictionary')
      }
    },
    {
      path: 'store',
      name: "storeManage",
      component: () => import('@/views/permissions/permission-store/index.vue'),
      meta: {
        title: t('routes.index.permission.store')
      }
    }
  ],
};

export default permission;
